home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / animflipper.lha / Flipper / AF.doc < prev    next >
Text File  |  1996-06-19  |  8KB  |  190 lines

  1.  
  2. AnimFlipper -- An example of a better way to string together 
  3.                Anims and IFFs in Amos Pro.  Freeware.
  4.                ©1993, 1996 Steve Tiffany  
  5.  
  6. AnimFlipper is heavily commented.  Read the comments!
  7.  
  8. --------------------------
  9.  
  10.  
  11. WHAT'S IT DO?
  12.  
  13. AnimFlipper demonstrates a way to display anims that's easy to 
  14. use yet gives you a fair amount of control.  Use the program as a 
  15. starting point for your own presentations--Just Add Anims!
  16.  
  17. The EXHIBITANIM[] procedure is the heart of the program, and it 
  18. was designed as a replacement for Amos Pro's `Iff Anim' command.  
  19. On my system at least, the special screen that Iff Anim opens is 
  20. too low and too far to the right, and there's no way to relocate 
  21. it.  EXHIBITANIM[] uses screens that respond to Screen Display.  
  22.  
  23. Where `Iff Anim' inexplicably loops past the end and leaves you 
  24. looking at Frame 2, EXHIBITANIM[] correctly displays the anim's 
  25. LAST frame while the next anim is loading.  Finally, EXHIBITANIM[] gives 
  26. you the option of displaying Frame 1 for a specific length of 
  27. time or until the user clicks the mouse.
  28.  
  29. The companion procedure EXHIBIT[] displays IFFs.
  30.  
  31. Even if you don't need to show anims, take a look at the 
  32. SCRNCENTER[] procedure.  It can prevent your programs from 
  33. looking off-center on other people's systems. 
  34.  
  35.  
  36.  
  37. --------------------------
  38.  
  39.  
  40. EXHIBITANIM["Work:Anim/MyFile.anim",0,0,1,1]
  41.  
  42.  
  43. This is the procedure that does the important work of loading and 
  44. playing your anims. 
  45.  
  46. Parameters for EXHIBITANIM[] are as follows:
  47.  
  48.  AN$........ The path and file name of the anim you want to play, in quotes. 
  49.  
  50.  TRIGGER.... What to wait for before displaying first frame of this anim:   
  51.                If value is -1 then wait for mouse click.  
  52.                If value is 0 then display it as soon as it's loaded.  
  53.                If value is greater than 0 then Wait TRIGGER 
  54.                   (60 = 1 second in NTSC or 50 = 1 second in PAL). 
  55.  
  56.  HOLDFRAME1  What to wait for with the first frame displayed before the 
  57.              rest of the anim starts to play:     
  58.                Same values as TRIGGER.  
  59.  
  60.  MIDFRAME... How long to Wait between anim frames. Value of 0 plays   
  61.              fastest.  Higher numbers play slower.     
  62.  
  63.  NUMLOOPS... How many times the anim should play.     
  64.              Recommended value is 1.  
  65.  
  66. --------------------------
  67. EXHIBIT["Work:Picture/MyFile.iff",240]
  68.  
  69. AnimFlipper includes the EXHIBIT[] procedure for displaying IFFs 
  70. in the same environment that EXHIBITANIM[] uses.  Parameters for 
  71. EXHIBIT[] are as follows:  
  72.  
  73.  PIC$....... The path and file name of the IFF picture to show, in quotes. 
  74.  
  75.  TRIGGER.... What to wait for before displaying this picture: 
  76.                If value is -1 then wait for mouse click.  
  77.                If value is 0 then display it as soon as it's loaded.  
  78.                If value is greater than 0 then Wait TRIGGER 
  79.                   (60 = 1 second in NTSC or 50 = 1 second in PAL). 
  80.  
  81. Note that if you're writing a slide show with no anims, you're 
  82. better off skipping EXHIBIT[] and the AnimFlipper environment 
  83. entirely and just using 2 unbuffered screens and Screen To Front.  
  84. AnimFlipper uses one unbuffered screen and one double buffered 
  85. screen, which is a waste of chip ram if you aren't showing anims.  
  86. (You want to use two unbuffered screens because slide shows which 
  87. use a single double buffered screen may produce an ugly flash 
  88. when pictures have different palettes.)  
  89. --------------------------
  90. SCRNCENTER[SCRNWIDTH,SCRNHEIGHT]
  91.                /          /    
  92.            320,352    200,240 NTSC (400,480 won't work w/OS 3.1)
  93.            640,704    256,290 PAL
  94.  
  95. How often have you seen otherwise-enjoyable AMOS programs where 
  96. the screen is way over on one side of the monitor?  Now you can 
  97. make sure your programs don't look that way on other people's 
  98. systems.  SCRNCENTER[] is a procedure that lets the user 
  99. permanently center the screen for his or her particular machine.  
  100. Here's how it works:
  101.  
  102. When your program calls SCRNCENTER[], the procedure looks for a 
  103. tiny config file in the user's S: directory.  If it finds it, the 
  104. procedure opens it and reads two numbers, XOFFSET and YOFFSET, 
  105. and then your program uses them to center the screen with the 
  106. Screen Display command.  If the file's not there, it presents the 
  107. user with a screen they can center by moving the mouse.  When 
  108. they click the mouse, a requester suggests writing the values of 
  109. XOFFSET and YOFFSET to the config file in the user's S: or Ram: 
  110. directory.  If the user picks S:, the program centers itself from 
  111. then on.  If Ram:, just til they reboot.
  112.  
  113. I'd like to propose a standard of sorts: Plug the SCRNCENTER[] 
  114. procedure into your own programs without modification, and it 
  115. will correctly select one of the following files to hold the 
  116. values of XOFFSET and YOFFSET:
  117.  
  118.       AmosXyOffsetNTSC.config    if it's 320x200 or 640x200      
  119.  
  120.       AmosXyOverscanNTSC.config  if it's 352x240 or 704x240
  121.                               
  122.       AmosXyOffsetPAL.config     if it's 320x256 or 640x256
  123.  
  124.       AmosXyOverscanPAL.config   if it's 352x290 or 704x290 
  125.  
  126. If everyone uses this version of SCRNCENTER[], the average user 
  127. will only have to center his screens twice: once for standard 
  128. screens and once for overscan.  From then on, all new programs 
  129. that use SCRNCENTER[] will center themselves by reading the 
  130. config file.  Also, if we standardize to these four config file 
  131. names, people won't have a hundred different 11-byte files that 
  132. all do the same thing clogging up their S: directories.  
  133.  
  134. If you use the file to hold other information beyond XOFFSET and 
  135. YOFFSET, then please pick a different name for the file.
  136.  
  137. --------------------------
  138. LIMITATIONS
  139.  
  140. While EXHIBITANIM[] is a big improvement over `Iff Anim,' it
  141. still doesn't solve a couple of problems.  
  142.  
  143. One is the hesitation at the loop point if you play an anim more 
  144. than once.  I almost got rid of the NUMLOOPS parameter because of 
  145. this, but left it in for those anims that aren't hurt by a pause 
  146. at the loop (like when an object starts and ends off-screen).  
  147.  
  148. Another limitation is that there's always a freeze-frame between 
  149. anims while it loads the next one.  Try to design your programs 
  150. so the pause looks intentional.
  151.  
  152. EXHIBITANIM[] requires all the anims and IFFs to be the same 
  153. resolution and number of colors, and anims must be of the Anim-5 
  154. variety, the format used by DPaint. 
  155.  
  156. As currently set up, you're limited to anims of 999 or fewer 
  157. frames, but you can increase that by changing the two 999's near 
  158. the top of the EXHIBITANIM[] procedure. 
  159.  
  160.  
  161. The most noticeable limitation of SCRNCENTER[] is actually a 
  162. deficiency of AMOS itself.  AMOS screens adjust left/right in 
  163. 16 pixel jumps, meaning users can't fine-tune the screen location 
  164. without adjusting a knob on their monitors.  And if they do that, 
  165. it uncenters their Workbench screens.
  166.  
  167. SCRNCENTER[] assumes screens are standard sizes:
  168.    320x200, 640x200, 352x240, 704x240 in NTSC
  169.    320x256, 640x256, 352x290, 704x290 in PAL
  170. It actually works with Laced screens as well (320x400, etc.), but 
  171. AMOS can't handle those once you upgrade to OS 3.1.
  172.  
  173. SCRNCENTER[] hasn't been tested with games that use hardware 
  174. coordinates directly.
  175.  
  176.  
  177. --------------------------
  178.  
  179. Feel free to send comments by e-mail to stiffany@isd.net   
  180.  
  181. If these procedures help you create something cool, let me know 
  182. when you upload it to Aminet.  If it's not going on Aminet, by 
  183. all means copy it onto 880k floppies and send via snail mail, 
  184. FedEx, bike messenger or mule train to: 
  185.  
  186.       Steve Tiffany                    
  187.       3255 14th Ave. S #4
  188.       Minneapolis, MN  55407
  189.       USA                         (addresses current June 1996)
  190.